import 'package:mall/constant/app_parameters.dart';
import 'package:mall/constant/app_strings.dart';
import 'package:mall/constant/app_urls.dart';
import 'package:mall/modules/model/brand_detail_entity.dart';
import 'package:mall/utils/net/http_util.dart';

/**
 * Create by luyouxin
 * description
    Created by $USER_NAME on 2020/9/16.
 */

class BrandDetailService{
// 查询品牌详情
static Future<BrandDetailEntity> queryBrandDetail(int id) async {
  var parameters = {AppParameters.ID: id};
  var response = await HttpUtil.instance.get(AppUrls.BRAND_DETAIL, parameters: parameters);

  if (response[AppStrings.DATA] == null) {
    throw Exception(AppStrings.SERVER_EXCEPTION);
  }

  return BrandDetailEntity.fromJson(response[AppStrings.DATA]);
}
}